import dao.CheckItemDao;
import dao.impl.CheckItemDaoImpl;
import utils.ConnectionUtil;

import java.sql.Connection;
import java.sql.SQLException;

/**
 * @projectName: Hospital
 * @package: PACKAGE_NAME
 * @className: Test5
 * @author: 翟
 * @date: 2025/4/1 3:57
 */

public class Test5 {
    /**
     * 使用JDBC查询hospital数据库中的检查项目信息，并输出到控制台上
     */
    public static void main(String[] args) {
        Connection conn = null;
        try {
            conn = ConnectionUtil.getConnection();
            CheckItemDao checkItemDao = new CheckItemDaoImpl(conn);
            checkItemDao.getAll().forEach(System.out::println);
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            ConnectionUtil.closeALL(null , null , conn);
        }
    }
}
